<?php

class Form_adminSignup extends Form_Custom_General {

    public function init() {

        $u_username = $this->createElement('text', 'u_username')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'UserName should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array('class' => "span12", "placeholder" => "User Name"));
        $this->addElement($u_username);
        
        $u_name = $this->createElement('text', 'u_name')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Name should not be blank.')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array('class' => "span12", "placeholder" => "Name"));
        $this->addElement($u_name);
        
       
        $lgn_email = $this->createElement('text', 'lgn_email')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Email address should not be blank.')))
                ->addValidator(new Zend_Validate_EmailAddress())
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array('class' => "span12", "placeholder" => "E-mail address"));
        $lgn_email->getValidator('emailAddress')->setMessage("Email address is not valid.", Zend_Validate_EmailAddress::INVALID_FORMAT);
        $this->addElement($lgn_email);
        
        
        
        
        $minPwdValidator = new Zend_Validate_StringLength(array('min' => 6));
        $minPwdValidator->setMessage('Password should be minimum of 6 characters.');
        $lgn_password = $this->createElement('password', 'lgn_password')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Password should not be blank.')))
                ->addValidator($minPwdValidator, true)
                ->setAttribs(Array('class' => "span12", "placeholder" => "Password"));
        $this->addElement($lgn_password);

        $confirmpassword = $this->createElement('password', 'user_confirmpassword')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Confirm password should not be blank.')))
                ->setAttribs(Array('class' => "span12", "placeholder" => "Confirm password"));
        $this->addElement($confirmpassword);
        
        $job_id = $this->createElement('multiselect', 'job_id')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select jobskill')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("class" => "select2", "disabled"=>"disabled", "placeholder" => 'Job Skill'));
        $this->addElement($job_id);
        
        $other_skill = $this->createElement('text', 'other_skill')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Confirm password should not be blank.')))
                ->setAttribs(Array('class' => "span12 tagsinput","data-role" => "tagsinput"));
        $this->addElement($other_skill);
    }

}